<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>Module</title>
  <script src="vue.js"></script>
  <script src="vuex.js"></script>
</head>
<body>
<div id="app"></div>
<script>
  const module1 = {
    state: { name1: '张珊' },
  }
  const module2 = {
    state: { name2: '李斯' },
  }
  const store = new Vuex.Store({
    modules: {
      x: module1,
      y: module2
    }
  })
  var vm = new Vue({
    el: '#app',
    store
  })
  console.log(store.state.x)
  console.log(store.state.y)
</script>
</body>
</html>